package cn.echoedu.service;

import cn.echoedu.command.AddClassNotify;
import cn.echoedu.command.AppKeyErrorCommand;
import cn.echoedu.command.ClassListCommand;
import cn.echoedu.command.ClassNotifyDetail;
import cn.echoedu.command.ClassNotifyFirstCommand;
import cn.echoedu.command.ContactsClassCommand;
import cn.echoedu.command.ContactsListCommand;
import cn.echoedu.command.ContactsListControlCommand;
import cn.echoedu.command.ContactsMakeFriendCommand;
import cn.echoedu.command.DeleteClassNotify;
import cn.echoedu.command.DeleteSchoolNotifyCommand;
import cn.echoedu.command.DepartmentListCommand;
import cn.echoedu.command.ExceptionErrorCommand;
import cn.echoedu.command.FeedBackCommand;
import cn.echoedu.command.HotContactsListCommand;
import cn.echoedu.command.IndexPicQueryCommand;
import cn.echoedu.command.LoginCommand;
import cn.echoedu.command.NoAuthorityCommand;
import cn.echoedu.command.ProfessionalListCommand;
import cn.echoedu.command.QueryClassNotifyList;
import cn.echoedu.command.QuerySchoolInfoCommand;
import cn.echoedu.command.RegisterCommand;
import cn.echoedu.command.SchoolCalendarCommand;
import cn.echoedu.command.SchoolListCommand;
import cn.echoedu.command.SchoolNotifyDetailCommand;
import cn.echoedu.command.SchoolNotifyFirstCommand;
import cn.echoedu.command.SchoolNotifyListCommand;
import cn.echoedu.command.StudentListCommand;
import cn.echoedu.command.TeacherAddNotifyCommand;
import cn.echoedu.command.TokenErrorCommand;
import cn.echoedu.command.UpdateUserInfoCommand;
import cn.echoedu.command.base.BaseParam;
import cn.echoedu.command.base.Command;
import cn.echoedu.command.base.ExecuteParam;
import cn.echoedu.command.base.FailureParam;
import cn.echoedu.command.base.Invoker;
import cn.echoedu.command.base.SuccessParam;
import cn.echoedu.util.L;

public class ResponseService extends BaseService{
	private final String T="ResponseService������������������������>";

	Invoker invoker=new Invoker();
	public void doContactsList(SuccessParam successparam) {
		// TODO Auto-generated method stub
		final String M="doContactList******>>";
		L.p(T+M);
		Command command=new ContactsListCommand();
		invoker.setCommand(command);
		invoker.runSuccessCommand(successparam);
	}
	
	public void doQueryContactsListSuccess(SuccessParam successparam) {
		// TODO Auto-generated method stub
		final String M="doQueryContactsListSuccess******>>";
		L.p(T+M);
		Command command=new ContactsListControlCommand();
		invoker.setCommand(command);
		invoker.runSuccessCommand(successparam);
	}
	
	public void doContactsMakeFriend(SuccessParam successparam) {
		// TODO Auto-generated method stub
		final String M="doMakeFriend*******>>";
		L.p(T+M);
		
		Command command=new ContactsMakeFriendCommand();
		invoker.setCommand(command);
		invoker.runSuccessCommand(successparam);
	}

	public void doContactsClass(SuccessParam successparam) {
		// TODO Auto-generated method stub
		final String M="doContactsClass";
		L.p(T+M);
		
		Command command=new ContactsClassCommand();
		invoker.setCommand(command);
		invoker.runSuccessCommand(successparam);
	}

	public void doHotContactsList(SuccessParam successparam) {
		// TODO Auto-generated method stub
		final String M="doHotContactsList*********>>";
		L.p(T+M);
		
		Command command=new  HotContactsListCommand();
		invoker.setCommand(command);
		invoker.runSuccessCommand(successparam);
	}

	public void doIndexPicQuery(SuccessParam successparam) {
		// TODO Auto-generated method stub
		final String M="doIndexPicQuery********>>";
		L.p(T+M);
		
		Command command=new IndexPicQueryCommand();
		invoker.setCommand(command);
		invoker.runSuccessCommand(successparam);
	}

	public void doLoginFailure(FailureParam failureparam) {
		// TODO Auto-generated method stub
		final String M="doLoginFailure*******>>";
		L.p(T+M);
		Invoker invoker = new Invoker();
		Command command = new LoginCommand();
		invoker.setCommand(command);
		invoker.runFailureCommand(failureparam);
	}

	public void doLogin(SuccessParam successparam) {
		// TODO Auto-generated method stub
		final String M="doLogin*********>>";
		L.p(T+M);
		
		Command command=new LoginCommand();
		invoker.setCommand(command);
		invoker.runSuccessCommand(successparam);
	}

	public void doRegisterFailure(FailureParam failureparam) {
		// TODO Auto-generated method stub
		final String M="doRegisterFailure*********>>";
		L.p(T+M);
		
		Command command=new RegisterCommand();
		invoker.setCommand(command);
		invoker.runFailureCommand(failureparam);
	}

	public void doRegisterSuccess(SuccessParam successparam) {
		// TODO Auto-generated method stub
		final String M="doRegisterSucdess********>>";
		L.p(T+M);
	 
		Command command = new RegisterCommand();
		invoker.setCommand(command);
		invoker.runSuccessCommand(successparam);
	}
	
	public void doFeedBackFailure(FailureParam failureparam) {
		final String M="doFeedBackFailure*********>>";
		L.p(T+M);
		
		Command command=new FeedBackCommand();
		invoker.setCommand(command);
		invoker.runFailureCommand(failureparam);
	}

	public void doFeedBackSuccess(SuccessParam successparam) {
		final String M="doFeedBackSuccess********>>";
		L.p(T+M);
	 
		Command command = new FeedBackCommand();
		invoker.setCommand(command);
		invoker.runSuccessCommand(successparam);
	}

	public void doUpdateUserFailure(FailureParam failureparam) {
		// TODO Auto-generated method stub
		final String M="doUpdateUserFailure*******>>";
		L.p(T+M);
		 
		Command command = new UpdateUserInfoCommand();
		invoker.setCommand(command);
		invoker.runFailureCommand(failureparam);
	}

	public void doUpdateUserSuccess(SuccessParam successparam) {
		// TODO Auto-generated method stub
		final String M="doUpdateUserSuccess***********>>";
		L.p(T+M);
		 
		Command command = new UpdateUserInfoCommand();
		invoker.setCommand(command);
		invoker.runSuccessCommand(successparam);
	}

	public void doAppKeyError(ExecuteParam executeparam) {
		// TODO Auto-generated method stub
		final String M="doAppKeyError**********>>";
		L.p(T+M);
		 
		Command command = new AppKeyErrorCommand();
		invoker.setCommand(command);
		invoker.execute(executeparam);
	}
    public void doExceptionError(ExecuteParam exceptionparam){
    	final String M = "doExceptionEroor********>>";
    	L.p(T+M);
    	Command command = new ExceptionErrorCommand();
    	invoker.setCommand(command);
    	invoker.execute(exceptionparam);
    }
	public void doTokenError(ExecuteParam executeparam) {
		// TODO Auto-generated method stub
		final String M="doTokenError**************>>";
		L.p(T+M);
		 Command command =new TokenErrorCommand();
		invoker.setCommand(command);
		invoker.execute(executeparam);
	}

	public void doTeacherAddNotifySuccess(SuccessParam successparam) {
		// TODO Auto-generated method stub
		final String M = "doTeacherAddNotifySuccess*******>>";
		L.p(T+M);
		Command command = new  TeacherAddNotifyCommand();
		invoker.setCommand(command);
		invoker.runSuccessCommand(successparam);
	}

	public void doTeacherAddNotifyFailure(FailureParam failureparam) {
		// TODO Auto-generated method stub
		final String M = "doTeacherAddNotifyFailure**********>>";
		L.p(T+M);
		Command command = new TeacherAddNotifyCommand();
		invoker.setCommand(command);
		invoker.runFailureCommand(failureparam);
	}

	public void doProfessionalListSuccess(SuccessParam successparam) {
		// TODO Auto-generated method stub
		final String M = "doProfessionalListSuccess*********>>";
		L.p(T+M);
		Command command = new ProfessionalListCommand();
		invoker.setCommand(command);
		invoker.runSuccessCommand(successparam);
	}

	public void doQueryClassListSuccess(SuccessParam successparam) {
		// TODO Auto-generated method stub
		final String M = "doQueryClassListSuccess********>>";
		L.p(T+M);
		Command command = new ClassListCommand();
		invoker.setCommand(command);
		invoker.runSuccessCommand(successparam);
	}

	public void doQueryStudentListSuccess(SuccessParam successparam) {
		// TODO Auto-generated method stub
		final String M = "doQueryStudentListSuccess*********>>";
		L.p(T+M);
		Command command = new StudentListCommand();
		invoker.setCommand(command);
		invoker.runSuccessCommand(successparam);
	}

	public void doQuerySchoolNotifyList(SuccessParam successparam) {
		// TODO Auto-generated method stub
		final String M = "doQuerySchoolNotifyList**********>>";
		L.p(T+M);
		Command command = new SchoolNotifyListCommand();
		invoker.setCommand(command);
		invoker.runSuccessCommand(successparam);
	}

	public void doQuerySchoolNotifyListFailure(FailureParam failureparam) {
		// TODO Auto-generated method stub
		final String M = "doQuerySchoolNotifyListFailure*********>>";
		L.p(T+M);
	}

	public void doQuerySchoolNotifyDetail(BaseParam baseparam) {
		// TODO Auto-generated method stub
		final String M = "doQuerySchoolNotifyDetail**********>>";
		L.p(T+M);
		Command command = new SchoolNotifyDetailCommand();
		invoker.setCommand(command);
		if(baseparam instanceof SuccessParam){
			invoker.runSuccessCommand((SuccessParam)baseparam);
			
		}
	}

	public void doDeleteSchoolNotifySuccess(SuccessParam successparam) {
		// TODO Auto-generated method stub
		final String M = "doDeleteSchoolNotifySuccess*********>>";
		L.p(T+M);
		Command command = new DeleteSchoolNotifyCommand();
		invoker.setCommand(command);
		invoker.runSuccessCommand(successparam);
	}

	public void doDeleteSchoolNotifyFailure(FailureParam failureparam) {
		// TODO Auto-generated method stub
		final String M = "doDeleteSchoolNotifyFailure********>>";
		L.p(T+M);
		Command command = new DeleteSchoolNotifyCommand();
		invoker.setCommand(command);
		invoker.runFailureCommand(failureparam);
	}

	public void doQueryClassNotifyList(SuccessParam successparam) {
		// TODO Auto-generated method stub
		Command command = new QueryClassNotifyList();
		invoker.setCommand(command);
		invoker.runSuccessCommand(successparam);
	}

	public void doQueryClassNotifyListFailure(FailureParam failureparam) {
		// TODO Auto-generated method stub
		Command command = new QueryClassNotifyList();
		invoker.setCommand(command);
		invoker.runFailureCommand(failureparam);
	}

	public void doDeleteClassNotifySuccess(SuccessParam successparam) {
		// TODO Auto-generated method stub
		Command command = new DeleteClassNotify();
		invoker.setCommand(command);
		invoker.runSuccessCommand(successparam);
	}

	public void doDeleteClassNotifyFailure(FailureParam failureparam) {
		// TODO Auto-generated method stub
		Command command = new DeleteClassNotify();
		invoker.setCommand(command);
		invoker.runFailureCommand(failureparam);
	}

	public void doClassNotifyDetail(SuccessParam successparam) {
		// TODO Auto-generated method stub
		Command command = new ClassNotifyDetail();
		invoker.setCommand(command);
		invoker.runSuccessCommand(successparam);
	}

	public void doClassNotifyDetailSuccess(SuccessParam successparam) {
		// TODO Auto-generated method stub
		final String M = "doClassNotifyDetailSuccess**********>>";
		L.p(T+M);
		Command command = new ClassNotifyDetail();
		invoker.setCommand(command);
		invoker.runSuccessCommand(successparam);
	}

	public void doClassNotifyDetailFailure(FailureParam failureparam) {
		// TODO Auto-generated method stub
		Command command = new ClassNotifyDetail();
		invoker.setCommand(command);
		invoker.runFailureCommand(failureparam);
	}

	public void doAddClassNotifySuccess(SuccessParam successparam) {
		// TODO Auto-generated method stub
		Command command = new AddClassNotify();
		invoker.setCommand(command);
		invoker.runSuccessCommand(successparam); 
	}

	public void doAddNotifyClassFailure(FailureParam failureparam) {
		// TODO Auto-generated method stub
		Command command = new AddClassNotify();
		invoker.setCommand(command);
		invoker.runFailureCommand(failureparam);
	}

	public void doSchoolList(BaseParam baseparam) {
		// TODO Auto-generated method stub
		Command command = new SchoolListCommand();
		invoker.setCommand(command);
		
		if(baseparam instanceof SuccessParam){
			invoker.runSuccessCommand((SuccessParam)baseparam);
		}else if(baseparam instanceof FailureParam){
			invoker.runFailureCommand((FailureParam)baseparam);
		}
	}

	public void doDepartmentList(BaseParam baseparam) {
		// TODO Auto-generated method stub
		Command command = new DepartmentListCommand();
		invoker.setCommand(command);
		
		if(baseparam instanceof SuccessParam){
			invoker.runSuccessCommand((SuccessParam)baseparam);
		}
	}

	public void doSchoolInfo(BaseParam  param) {
		// TODO Auto-generated method stub
		Command command = new QuerySchoolInfoCommand();
		invoker.setCommand(command);
		if(param instanceof SuccessParam){
			invoker.runSuccessCommand((SuccessParam)param);
		}
	}

	public void doSchoolNotifyFirst(BaseParam param) {
		// TODO Auto-generated method stub
		Command command = new SchoolNotifyFirstCommand();
		invoker.setCommand(command);
		if(param instanceof SuccessParam){
			SuccessParam successparam = (SuccessParam)param;
			invoker.runSuccessCommand(successparam);
		}
	}

	public void doClassNotifyFirst(BaseParam param) {
		// TODO Auto-generated method stub
		Command command = new ClassNotifyFirstCommand();
		invoker.setCommand(command);
		if(param instanceof SuccessParam){
			SuccessParam successparam = (SuccessParam)param;
			invoker.runSuccessCommand(successparam);
		}
	}
	public void doClassNotifyFirstFail(FailureParam failureparam) {
		// TODO Auto-generated method stub
		Command command = new ClassNotifyFirstCommand();
		invoker.setCommand(command);
		invoker.runFailureCommand(failureparam);
	}
	
	public void doNoAuthority(ExecuteParam exceptionparam) {
		// TODO Auto-generated method stub
		Command command = new NoAuthorityCommand();
		Invoker invoker = new Invoker();
		invoker.setCommand(command);
		invoker.execute(exceptionparam);
	}
    public void doSchoolCalendarSuccess(BaseParam param) {
		// TODO Auto-generated method stub
    	Command command = new SchoolCalendarCommand();
		invoker.setCommand(command);
    	if(param instanceof SuccessParam){
    		invoker.runSuccessCommand((SuccessParam)param);
		}
	}
 }
